package cn.edu.controller;

import cn.edu.domain.All;
import cn.edu.domain.InfoPageBean;
import cn.edu.domain.PieData;
import cn.edu.service.dep_InfomationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * @author Davey chan
 */
@RestController
@RequestMapping("/dep_Infomation")
public class dep_InfomationController  {
@Autowired
private dep_InfomationService infomationService;
    /*分页查询*/
    @PostMapping("/{currentPage}/{pageSize}")
    public Result infoselect(@PathVariable Integer currentPage,
                             @PathVariable Integer pageSize,
                             @RequestBody All t){
        InfoPageBean<All> pageBean = infomationService.infoselect(currentPage, pageSize,t);
        return new Result(Code.GET_OK,pageBean);
    }
    @RequestMapping("/getPie")
    public Result getPie(){
        List<PieData> pie = infomationService.getpie();
        return new Result(Code.GET_OK,pie);
    }
    @RequestMapping("/getBar1")
    public Result getBar1(){
        List<Integer> bar = infomationService.getBar1();
        return new Result(Code.GET_OK,bar);
    }
    @RequestMapping("/getBar2")
    public  Result getBar2() {
        List<Integer> bar = infomationService.getBar2();
        return new Result(Code.GET_OK,bar);
    }
    @RequestMapping("/getBar3")
    public  Result getBar3() {
        List<Integer> bar = infomationService.getBar3();
        return new Result(Code.GET_OK,bar);
    }
}
